﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using mak_bll;

namespace markets
{
    public partial class login : Form
    {
        public login()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //业务逻辑层
            luoji us = new luoji();
            string name = textBox1.Text;
            string pass = textBox2.Text;
            bool hasData = us.UserLogin(name, pass);
            if (hasData)
            {
                int a=us.shenfen(name,pass);
                if (a == 1)
                { 
                   MessageBox.Show("普通员工");
                   buygoods gos = new buygoods();
                   gos.Show();
                   this.Hide();
                }
                else
                {
                    MessageBox.Show("管理员");
                    adminManage_ui ui = new adminManage_ui();
                    ui.Show();
                    this.Hide();
                }
                
            }
            else
            {
                MessageBox.Show("用户名密码错误");
            }
        }

       

    }
}
